import LockFactory from "./LockFactory.mjs";

export default class Lock {
    static factory = new LockFactory();

    build() {}
    /**
     * 获取锁，如果没得到，不阻塞
     * @param ttl 过期时间，单位毫秒
     * @param interval 重试间隔时间，单位毫秒
     * @param maxRetry 最大重试次数
     */
    acquire(ttl, interval, maxRetry) {}

    /**
     * 释放锁
     */
    release() {}

    /**
     * 获取锁工厂
     */
    factory() {
        return Lock.factory;
    }
}

process.on('lockException', err => {
    console.error("lockException: " + err.msg);
});

process.on('uncaughtException', err => {
    console.error("未捕获的异常: " + err.stack);
});



